<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019-03-24
 * Time: 下午 12:58
 */
$_sql = "	
	CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '活动id',
      `uniacid` smallint(5) unsigned NOT NULL COMMENT '公众号id',
      `name` varchar(20) DEFAULT NULL COMMENT '活动名称',
      `response_keyword` char(6) DEFAULT NULL COMMENT '活动的响应关键词',
      `open3d` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否开启3d地图',
      `cover` varchar(255) DEFAULT NULL COMMENT '活动的封面',
      `start` int(10) unsigned NOT NULL COMMENT '活动的开始时间',
      `end` int(10) unsigned NOT NULL COMMENT '活动的结束时间',
      `init_bz_number` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '用户初始可以开到的宝箱（0=不限制）',
      `open_distance` int(10) unsigned NOT NULL DEFAULT '5' COMMENT '打开宝箱的距离（设置为0则不限制距离所有人都可以打开宝箱）',
      `get_coupon_bourn` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否强制用户到活动区域才可以领取卡券（1=是，0=不强制）',
      `bz_number` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '地图宝箱初始显示数量（0=系统字段计算）',
      `brief` varchar(255) DEFAULT NULL COMMENT '活动的简介',
      `explain` text COMMENT '活动说明',
      `address` varchar(255) NOT NULL COMMENT '活动的地址',
      `map_coords` text NOT NULL COMMENT '活动区域的选择坐标',
      `edit_time` int(10) unsigned NOT NULL COMMENT '活动编辑的时间',
      `status` tinyint(1) unsigned NOT NULL DEFAULT '2' COMMENT '状态(1=正常，2=等待审核，3=暂停活动，9=删除)',
      `entity_address` varchar(255) DEFAULT NULL COMMENT '实物奖励兑换地址',
      `bz_win_odds` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '虚拟宝藏的中奖率',
      `entity_win_odds` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '实物宝藏的中奖率',
      `coupon_win_odds` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '门店卡券中奖率',
      `shop_model` tinyint(1) unsigned DEFAULT '0' COMMENT '是否启用商场模式',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
	
	CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_admin` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `uniacid` smallint(5) unsigned NOT NULL COMMENT '公众号id',
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `account` char(20) NOT NULL COMMENT '管理账号',
      `password` char(40) NOT NULL COMMENT '账户密码',
      `salt` char(10) NOT NULL COMMENT '密码验证盐',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_coupon` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '活动投放的卡券',
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `store_id` int(10) unsigned NOT NULL COMMENT '门店id',
      `coupon_id` int(10) unsigned NOT NULL COMMENT '卡券id',
      `goal` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '投放目标（1=宝箱，2=领券页面）',
      `number` mediumint(8) unsigned NOT NULL COMMENT '投放数量',
      `give_number` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '已经发放的卡券数量',
      `user_number` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '用户最多获取数量',
      `use_limit_type` tinyint(1) unsigned NOT NULL COMMENT '是否开启使用时间限制(1=不开启，随时可用，2=超时限制，3=计时限制）',
      `limit_time` int(10) unsigned NOT NULL COMMENT '卡券使用限制值（长度=10超时，长度!=计时限制天数）',
      `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '投放的卡券状态（1=正常，2=审核中，3=审核失败，4=撤销）',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_invite` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `share_uid` int(10) unsigned NOT NULL COMMENT '分享的用户id',
      `invite_uid` int(10) unsigned NOT NULL COMMENT '邀请的用户id',
      `award_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '奖励的类型(1=打开宝箱的次数)',
      `open_count` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '奖励的打开宝箱次数',
      `time` int(10) unsigned NOT NULL COMMENT '邀请的时间',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_member` (
      `id` mediumint(7) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
      `uniacid` smallint(3) unsigned NOT NULL COMMENT '公众号id',
      `activity_id` mediumint(7) unsigned NOT NULL COMMENT '活动id',
      `uid` int(10) unsigned NOT NULL COMMENT '用户id(微擎的uid)',
      `open_num` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '会员可开宝箱数量',
      `time` int(10) unsigned NOT NULL COMMENT '参与时间',
      `exchange_number` varchar(6) DEFAULT NULL COMMENT '用户兑换码',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_member_treasure` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '会员活动宝藏id',
      `uid` int(10) unsigned NOT NULL COMMENT '会员id',
      `activity_id` mediumint(7) unsigned NOT NULL COMMENT '活动id',
      `treasure_id` int(10) unsigned NOT NULL COMMENT '宝藏id(0=空宝箱)',
      `number` mediumint(7) unsigned NOT NULL DEFAULT '1' COMMENT '宝藏数量',
      `exchange` mediumint(7) unsigned NOT NULL DEFAULT '0' COMMENT '宝藏兑换数量',
      `type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '开到的宝藏类型（0=空宝箱，1=虚拟财宝，2=实物，3=卡券）',
      `source` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '来源（1=开宝箱，2=领券页面）',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_setting` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `coupon_check` tinyint(1) unsigned NOT NULL DEFAULT '2' COMMENT '门店投放卡券状态（1=无需审核，2=需要审核）',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_share` (
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `open_share` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '分享活动是否开启',
      `add_bz` smallint(3) unsigned NOT NULL DEFAULT '1' COMMENT '成功邀请一个新增宝箱数量',
      `take_m` varchar(100) NOT NULL COMMENT '分享奖励生效距离',
      `poster_path` varchar(255) DEFAULT NULL COMMENT '活动海报背景图路径',
      `qr_width` smallint(5) unsigned NOT NULL DEFAULT '100' COMMENT '二维码宽度',
      `qr_height` smallint(5) unsigned NOT NULL DEFAULT '100' COMMENT '二维码高度',
      `qr_left` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '二维码left值',
      `qr_top` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '二维码top值',
      `edit_time` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '修改配置时间',
      PRIMARY KEY (`activity_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_treasure` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动的id',
      `name` varchar(20) NOT NULL COMMENT '宝藏名字',
      `icon` varchar(255) NOT NULL COMMENT '宝藏图标',
      `money` decimal(10,2) unsigned NOT NULL COMMENT '宝藏价格',
      `number` int(10) unsigned NOT NULL COMMENT '宝藏的数量',
      `give_number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已经发放的宝藏',
      `user_number` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '每个用户获得数量',
      `type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '类型（1=宝藏，2=实物）',
      `win_odds` int(10) unsigned NOT NULL DEFAULT '10' COMMENT '中奖率',
      `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(1=正常，2=暂停投放)',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_adver` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '广告表',
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `start_adver` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '广告开启状态',
      `adver_url` varchar(255) DEFAULT NULL COMMENT '广告链接',
      `interval_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '广告显示间隔时间',
      `interval_unit` varchar(10) NOT NULL COMMENT '广告显示间隔单位',
      `adver_image` varchar(255) DEFAULT NULL COMMENT '广告图片',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_after_person` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '活动核销人员',
      `uniacid` smallint(5) unsigned NOT NULL COMMENT '公众号id',
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `uid` int(10) unsigned NOT NULL COMMENT '用户id',
      `status` tinyint(1) unsigned NOT NULL DEFAULT '2' COMMENT '状态（1=正常，2=等待审核，3=拒绝审核，9=删除）',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_exchange` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '提现id',
      `uniacid` smallint(3) unsigned NOT NULL COMMENT '公众号id',
      `uid` int(10) unsigned NOT NULL COMMENT '会员id',
      `money` decimal(10,2) unsigned NOT NULL COMMENT '提现金额',
      `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '提现状态 0=等待提现，1=提现成功，2=拒绝提现，9=删除',
      `time` int(10) unsigned NOT NULL COMMENT '提现时间',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_member` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `uniacid` smallint(5) unsigned NOT NULL,
      `uid` int(10) unsigned NOT NULL,
      `money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '用户余额',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
     CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_setting` (
      `id` smallint(3) unsigned NOT NULL AUTO_INCREMENT,
      `uniacid` smallint(3) unsigned NOT NULL COMMENT '公众号id',
      `appid` varchar(50) DEFAULT NULL COMMENT '公众号appid',
      `app_secret` varchar(50) DEFAULT NULL COMMENT 'secret',
      `mcht_account` varchar(50) DEFAULT NULL COMMENT '商户账号',
      `mcht_key` varchar(50) DEFAULT NULL COMMENT '商户密钥',
      `map_key` varchar(50) DEFAULT NULL COMMENT '高德地图API',
      `domain_defend` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否开启域名防封（1=开启，默认0不开启）',
      `deposit_limit` decimal(10,2) unsigned DEFAULT '1.00' COMMENT '用户余额满多少可提现',
      `deposit_check` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '提现金额大于多少需要审核，默认0所有提现都需要审核',
      `deposit_enter_detail` varchar(20) DEFAULT NULL COMMENT '用户提现入账详情',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_store` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '门店',
      `uniacid` smallint(5) unsigned NOT NULL COMMENT '公众号id',
      `name` varchar(50) NOT NULL COMMENT '门店名称',
      `logo` varchar(255) DEFAULT NULL COMMENT '门店logo',
      `address` varchar(255) DEFAULT NULL COMMENT '门店地址',
      `sell_range` varchar(20) DEFAULT NULL,
      `status` tinyint(1) unsigned NOT NULL DEFAULT '2' COMMENT '门店状态（1=正常，2=审核中，3=拒绝，4，锁定，9=删除）',
      `location` varchar(100) NOT NULL COMMENT '门店定位位置经纬度',
      `create_time` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '门店注册日期',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_store_coupon` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '门店卡券',
      `uniacid` smallint(5) unsigned NOT NULL COMMENT '公众号id',
      `store_id` int(10) unsigned NOT NULL COMMENT '门店id',
      `name` varchar(50) NOT NULL COMMENT '卡券名字',
      `images` text NOT NULL,
      `type` char(2) NOT NULL COMMENT '卡券类型',
      `cost` varchar(255) NOT NULL COMMENT '卡券内容、面值等等相关信息',
      `rule` text NOT NULL,
      `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '卡券状态（1=正常，9=删除）',
      `edit_time` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '卡券修改时间',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_store_manage` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '系统门店的经营范围',
      `uniacid` smallint(5) unsigned NOT NULL COMMENT '公众号id',
      `name` char(10) NOT NULL COMMENT '名字',
      `status` tinyint(1) unsigned NOT NULL DEFAULT '2' COMMENT '状态（1=正常，2=等待审核，3=系统禁用经营范围，9=删除）',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_store_position` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '职位id',
      `store_id` int(10) unsigned NOT NULL COMMENT '门店id',
      `name` char(5) NOT NULL COMMENT '职位名称',
      `authority` varchar(255) NOT NULL COMMENT '权限集合（json）',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_store_staff` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '门店职位id',
      `uniacid` smallint(5) unsigned NOT NULL COMMENT '公众号id',
      `store_id` int(10) unsigned NOT NULL COMMENT '门店id',
      `position_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '职位id（0=店长，>0=其他职位）',
      `uid` int(10) unsigned NOT NULL COMMENT '用户id',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_treasure` (
      `id` mediumint(7) unsigned NOT NULL AUTO_INCREMENT,
      `uniacid` smallint(5) unsigned NOT NULL COMMENT '公众号id',
      `name` varchar(20) NOT NULL COMMENT '宝藏名字',
      `icon` varchar(255) NOT NULL COMMENT '宝藏图标',
      `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_give_coupon` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `store_id` int(10) unsigned NOT NULL COMMENT '门店id',
      `time` int(10) unsigned NOT NULL COMMENT '发券时间',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_after_coupon` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '门店卡券核销记录',
      `store_id` int(10) unsigned NOT NULL COMMENT '门店id',
      `staff_id` int(10) unsigned NOT NULL COMMENT '核销的员工id',
      `uid` int(10) unsigned NOT NULL COMMENT '被核销的用户id',
      `time` int(10) unsigned NOT NULL COMMENT '核销的时间戳',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_coupon_snapshot` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '卡券快照',
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `store_id` int(10) unsigned NOT NULL COMMENT '门店id',
      `uid` int(10) unsigned NOT NULL COMMENT '用户id',
      `coupon_id` int(10) unsigned NOT NULL COMMENT '卡券id',
      `number` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT '卡券快照数量',
      `use_number` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '使用核销数量',
      `past_time` int(10) unsigned NOT NULL COMMENT '卡券的过期时间（1=永久有效）',
      `edit_time` int(10) unsigned NOT NULL COMMENT '卡券的修改时间，用于对比系统卡券的修改时间，卡券有修改则重新生成新的快照',
      `detail` longtext NOT NULL,
      `activity_coupon_id` int(11) unsigned NOT NULL COMMENT '活动投放的卡券id',
      `type` char(2) NOT NULL COMMENT '卡券类型',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_sponsor_coupon` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '活动投放的卡券',
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `name` varchar(20) NOT NULL COMMENT '卡券的名字',
      `icon` varchar(255) NOT NULL COMMENT '兑换奖品图片',
      `rule` text NOT NULL COMMENT '卡券使用规则',
      `money` decimal(10,2) unsigned NOT NULL COMMENT '兑换奖品价值（原价）',
      `number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '投放数量',
      `give_number` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已发放数量',
      `user_number` int(10) unsigned NOT NULL COMMENT '用户可获取数量',
      `win_odds` int(10) unsigned NOT NULL COMMENT '中奖几率',
      `use_limit_type` tinyint(1) unsigned NOT NULL COMMENT '使用时间的限制（1=永久有效，2=超时限制，3=计时限制）',
      `limit_time` int(10) unsigned NOT NULL COMMENT '有效期(timestamp超时时间戳，number有效天数、0永久有效)',
      `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(1=正常投放，2=暂停投放)',
      `edit_time` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '修改卡券的时间',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
     CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_system_friend` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `name` char(10) NOT NULL COMMENT '好友名字',
      `header` varchar(255) NOT NULL COMMENT '头像',
      `open_count` smallint(3) unsigned NOT NULL DEFAULT '1' COMMENT '赠送宝箱可开数量',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_friend_award_record` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `friend_id` int(10) unsigned NOT NULL COMMENT '好友关系id',
      `uid` int(10) unsigned NOT NULL COMMENT '领取的用户id',
      `number` smallint(3) unsigned NOT NULL COMMENT '领取数量',
      `from` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '来自哪里（1=好友，2=系统好友）',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_map_skin` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `uniacid` smallint(5) unsigned NOT NULL COMMENT '公众号id',
      `name` char(5) NOT NULL COMMENT '皮肤名称',
      `value` char(32) NOT NULL COMMENT '皮肤标识',
      `source` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '皮肤来源（1=自定义，2=系统默认）',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `ims_kuyuan_vbz_activity_ui` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `activity_id` int(10) unsigned NOT NULL COMMENT '活动id',
      `skin` char(32) DEFAULT NULL COMMENT '高德地图自定义皮肤',
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
";

pdo_run($_sql);